//
//  CDBugTrackService.swift
//  CandyDate
//
//  Created by zolobdz on 2017/11/20.
//  Copyright © 2017年 HeChao. All rights reserved.
//

import Foundation

/*
 live
 App Key      9fcb51bae2f79941bf592f3477a42f18
 App Secret  301ee52e99c071486206fe31c5689328
 
 beta
 App Key      a39a1dde9a7ec1ebc72f384519235890
 App Secret  b64406a7cccc7ee7122b33624efeada1
 */
//class CDBugTrackService {
//    
//    static let shared = CDBugTrackService()
//    private init() {}
//    
//    func startService() {
//        
//        let option = BugtagsOptions()
//        option.trackingNetwork = true
//        option.trackingNetworkURLFilter = "datasheetdownload.cn"
//        #if APPSTORE
//            Bugtags.start(withAppKey: "9fcb51bae2f79941bf592f3477a42f18", invocationEvent: BTGInvocationEventNone, options: option)
//        #else
//            Bugtags.start(withAppKey: "a39a1dde9a7ec1ebc72f384519235890", invocationEvent: BTGInvocationEventShake, options: option)
//        #endif
//        
//        setupUserData()
//    }
//    
//    func setupUserData() {
//        guard let userID = MyselfSingleton.shared.userInfo?.userID,!userID.isEmpty else {
//            return
//        }
//        let name = MyselfSingleton.shared.userInfo?.nickName ?? ""
//        let avatar = MyselfSingleton.shared.userInfo?.avatar ?? ""
//        let mobile = MyselfSingleton.shared.userInfo?.mobile ?? ""
//        let gender = MyselfSingleton.shared.userInfo?.gender ?? "unknow"
//        Bugtags.setUserData(userID, forKey: "userID")
//        Bugtags.setUserData(name, forKey: "nickName")
//        Bugtags.setUserData(avatar, forKey: "avatar")
//        Bugtags.setUserData(mobile, forKey: "mobile")
//        Bugtags.setUserData(gender, forKey: "gender")
//        
//    }
//    
//}
